import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '部门',
    align:"center",
    dataIndex: 'departmentId_dictText'
   },
   {
    title: '姓名',
    align:"center",
    dataIndex: 'name'
   },
  {
    title: '学号',
    align:"center",
    dataIndex: 'code'
   },
   {
    title: '创建日期',
    align:"center",
    dataIndex: 'createTime'
   },
   {
    title: '支付时间',
    align:"center",
    dataIndex: 'payTime'
   },
   {
    title: '商户订单号',
    align:"center",
    dataIndex: 'outTradeNo'
   },
   {
    title: '支付金额',
    align:"center",
    dataIndex: 'payMoney'
   },
   {
    title: '支付状态',
    align:"center",
    slots: { customRender: 'status'}
    // dataIndex: 'payStatus',
    // customRender:({text}) =>{
    //   return render.renderDict(text, 'course_pay_status');
    // },
   },
   {
    title: '总节数',
    align:"center",
    dataIndex: 'totalClassDay'
   },
   {
    title: '退课数',
    align:"center",
    dataIndex: 'lessClassDay'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: '学号',
    field: 'code',
    component: 'Input',
   },
   {
    label: '姓名',
    field: 'name',
    component: 'Input',
   },
  {
      label: "支付时间",
      field: "payTime",
      component: 'RangePicker',
      componentProps: {
          valueType: 'Date',
      },
      //colProps: {span: 6},
	},
	{
      label: "支付状态",
      field: 'payStatus',
      component: 'JDictSelectTag',
      componentProps:{
        dictCode:"course_pay_status"
      },
      //colProps: {span: 6},
 	}
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '人员id',
    field: 'personId',
    component: 'Input',
  },
  {
    label: '商户订单号',
    field: 'outTradeNo',
    component: 'Input',
  },
  {
    label: '支付金额',
    field: 'payMoney',
    component: 'InputNumber',
  },
  {
    label: '订单id',
    field: 'transactionId',
    component: 'Input',
  },
  {
    label: '学生课程id',
    field: 'enrollmentsId',
    component: 'Input',
  },
  {
    label: '支付状态',
    field: 'payStatus',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:""
     },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];


export const payDetailColumns: BasicColumn[] = [
  {
   title: '科目',
   align:"center",
   dataIndex: 'courseId_dictText'
  },
  {
   title: '支付金额',
   align:"center",
   dataIndex: 'money'
  },
];


// 高级查询数据
export const superQuerySchema = {
  createTime: {title: '创建日期',order: 0,view: 'datetime', type: 'string',},
  updateTime: {title: '支付时间',order: 1,view: 'datetime', type: 'string',},
  personId: {title: '人员id',order: 2,view: 'text', type: 'string',},
  outTradeNo: {title: '商户订单号',order: 3,view: 'text', type: 'string',},
  payMoney: {title: '支付金额',order: 4,view: 'number', type: 'number',},
  transactionId: {title: '订单id',order: 5,view: 'text', type: 'string',},
  enrollmentsId: {title: '学生课程id',order: 6,view: 'text', type: 'string',},
  payStatus: {title: '支付状态',order: 7,view: 'number', type: 'number',}
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}